#ifndef BOARD_H
#define BOARD_H

#include <QVector>
#include <QString>
#include <QStringList>
#include <QVariant>
#include <QObject>
#include <QDateTime>
#include <QAbstractListModel>
#include <QModelIndex>
#include "topic.h"
#include "profile.h"

class Board : public baseOnProfile{
    Q_OBJECT
    friend class Topic;
    friend class Article;
    friend class BBS;
    public:
	~Board();
	Board(QString newId = 0 , QString newName = 0);
	virtual QString display(void);
	QString id;
	QString name;
	bool favorite;
	QVector<Topic *> topicPool;
    public slots:
	//刷新本版块的话题
	virtual void refreshMe() {};
	//在本版块发表新帖子
	virtual void send(QString /*title*/, QString /*signature*/, QString /*Text*/){};
    signals:
	void refreshFinished(bool error);
	void newStatus(int statusCode, QString explain);
    protected:
	//将新话题添加至本版块
	bool addTopic(Topic * topip);
};

class boardModel : public QAbstractListModel {
    ///this MODEL maybe only to show the Topic list...?
    Q_OBJECT
    public:
	boardModel(QObject *parent = 0);
	void setBoard (Board * newBoard);
	int rowCount (const QModelIndex &index) const;
	QVariant data(const QModelIndex &index, int role) const;
	QModelIndex index(int row, int column, const QModelIndex &parent) const;
    private:
	Board * board;
    public slots:
	void refresh(bool);
};

#endif